<?php template('header',array('title'=>'最新讨论'))?>
<div id="wrapper">
	<div class="content">


		<div class="full">

				<div id="forum-buttons">
			  <div class="full">
				<button class="success">发帖</button>
				<a href="/bbs/create" class="btn">发帖</a>
			  </div>
			  <div class="full">
				<div class="half"> &nbsp;</div>
				<div class="half pager-right">
				  <?=layout::pager('/bbs/'.baseUrl(1).'/',$latestList['page'],baseUrl(2))?>
				</div>
			  </div>
			</div>
			<div class="item-list">

			   <?php for ($i=0; $i <5 ; $i++) :?> 
			   <?php foreach($latestList['list'] as $topic):?>

			   <div class="topic-item full">
					<div class="topic-title two-thirds">
						 <?=anchor('/bbs/f/'.$topic['forum_id'],'['.$topic['forum_name'].']','forum-id');?>
					 <?=anchor("/bbs/t/{$topic['post_id']}",$topic['post_title'],'t-'.($topic['state']+1))?>
					 <?=postStateImg($topic['state'],$topic['replies'],$topic['views']);?>
					</div>
					<div class="topic-meta third">
							<div class="meta-author">
							  <?=anchor('/u/'.$topic['author_id'],$topic['author_name'],'author')?>
					  <span><?=dateFormat($topic['post_create_time'])?></span> 
							</div>
							<div class="meta-replyer">
								<?=anchor('/u/'.$topic['replyer_id'],$topic['replyer_name'],'replyer');?>
						<span><?=dateFormat($topic['post_active_time'])?></span>
							</div>          		
							<div class="meta-views">
								<a href="" class="replynum"><?=$topic['replies']?></a>
					  <span><?=$topic['views']?></span>
							</div>          		
					</div>
			   </div>

			   <?php endforeach;?>
			   <?php endfor;?>
				 <div class="full">
				  <div class="half"> &nbsp; </div>
				  <div class="half pager-right">
					<?=layout::pager('/bbs/'.baseUrl(1).'/',$latestList['page'],baseUrl(2))?>
				  </div>
				</div>

			</div>
		</div>  <!-- end full -->

	<div class="full s-forum-list">
		  <div>
			<h3>全部板块</h3>
		  </div>
		  <div class="half">
		  <?php foreach ($forumList as $k => $f): ?>
			  <?php if($k%3==0&&$k!=0):?> </div><div class="half"> <?php endif;?>
			  <?=anchor("/bbs/f/{$f['id']}",img($f['logo'],$f['name'],'forum-logo'))?>
		  <?php endforeach;?>
		  </div>

	</div>

	</div>
</div>
<?php template('footer')?>